1. Field of the Invention
Preferred embodiments provide a method, system, program, and data structures for loading programs, including program components and dependencies, into a runtime environment.
2. Description of the Related Art
A program interpreter is a module that decodes and executes every statement in some body of code. For instance, in the Java programming environment, the Java interpreter decodes and executes bytecodes for the Java Virtual Machine.** The Java Platform converts Java source code (.Java files) to bytecodes (.class files), which are machine independent representations of a Java class. Thus, the same bytecodes would be created for all operating system platforms. The bytecodes are then inputted to a Java Virtual Machine program that converts the byte codes to the object code in the native machine language of the operating system on which the Java Virtual Machine is installed.
When upgrading to a new version of a Java Virtual Machine, which is distributed in a Java Development Kit (JDK), that also includes a Java Interpreter and other application tools and interfaces for Java programs, the new class and methods of the new Java Virtual Machine and JDK are loaded into memory.** This update may overwrite older versions of certain methods and classes used in the previous version of the JDK. Thus, there is an issue as to whether a Java program written for an older version of the JDK is compatible with the updated JDK, which may modify certain methods and classes used by the program. For instance, JDK 1.1.x is upwards source-compatible with 1.0.x, except for certain incompatibilities. This means that source files written to use the language features and APIs defined for 1.0.x can be compiled in 1.1.x and will run in 1.1.x. Downward source compatibility is not supported. If source files use new language features or APIs in JDK 1.1.x, they will not be usable with an earlier version of Java, e.g., JDK 1.0x. Further, there are many instances in which there is upward incompatibility, such as when APIs and methods have changed.
** Java and JDBC are trademarks of Sun Microsystems, Inc.; Microsoft and Windows are registered trademarks of Microsoft Corporation; OS/2 is a registered trademark of International Business Machines Corporation; Netscape is a registered trademark and Netscape Communicator, Netscape Navigator, Mozilla are trademarks of Netscape Communications Corporation; QuickTime is a trademark of Apple Computer, Inc. 
Still further, there is upward incompatibility if a program includes a fix for a bug in an earlier version 1.0.x and the later version 1.1.x corrects the bug. In such case, the fix in the program will not work because the bug is no longer present in the newer version 1.1.x.
Thus, there is a need in the art to allow programs written for one version of a JDK kit, or language translator, to be compatible with later and previous versions of the same translator.
To overcome the limitations in the prior art described above, preferred embodiments disclose a method, system, program, and data structures for installing components in a computer runtime environment. A kit file is retrieved including information on program components to load into memory. The retrieved kit file information is used to retrieve the program components for the kit file to load into the runtime environment. A determination is made as to whether there are dependency kit files associated with the retrieved kit file. Program components for each determined dependency kit file are maintained in the runtime environment, wherein classes and interfaces are resolved using the program components loaded into the runtime environment.
In further embodiments, the retrieved program components for the retrieved kit file and the program components for the determined dependency kit files are stored in the file directory.
In still further embodiments, a kit object is associated with each kit file and the program components of the kit file loaded in the runtime environment. The kit objects are linked such that the order in which the kit objects are linked indicates an order in which the program components for the associated kit files are considered to resolve a program call. In this way, the program components associated with one kit object at a relatively higher order in the linking of the kit objects are considered before the program components associated with kit objects at a relatively later order in the linking.
The preferred embodiments provide a system for loading all the program components needed to support a kit file for a program, including any dependency kit files and program components needed for the runtime environment. Preferred embodiments provide a technique for loading program components associated with kit files into memory in a manner that allows different versions of a same kit file to be considered in a different order for resolving classes and interfaces called from different programs executing in the runtime environment. Preferred embodiments provide a technique to store the program components of kit files in an installation directory for later use when installing the program components into the runtime environment for a particular program.